<!--<script type="text/javascript">
    jQuery(document).ready(function(){
            tableToGrid("#mytable");
    });
</script>
-->

<!-- cuerpo -->
<div id="yui-main">
    <div class="yui-b">
        <div class="yui-gc">
            <div class="yui-u first">
                <div class="ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix" style="padding:5px;">
                    <h1>Igrese cantidade a comprar</h1>
                </div>
                <div id="gbox_editgrid" class="ui-jqgrid ui-widget ui-widget-content ui-corner-all" dir="ltr" style="padding:5px;">
                    <?=$this->modelo_ec->vista_breadcrumb;?><br><br>
                    <div>
                        <form action="<?=base_url()?>index.php/ecommerce_empresa1/cargar_pedido" method="post">
                            <table style="border-spacing: 2em;"  id="mytable" class="ui-jqgrid ui-widget ui-widget-content ui-corner-all" border="1" align="center">
                                <thead>
                                    <tr>
                                        <th>Imagen</th>
                                        <th>Codigo</th>
                                        <th>Descripcion</th>
                                        <th>Precio</th>
                                        <th>Cant.</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                    $color=1;
                                    $index=1;
                                    foreach ($consulta->result() as $row):?>
                                        <?php $query = $this->db->query("SELECT * FROM product WHERE product_id=".$row->product_id);
                                        foreach ($query->result() as $row3):
                                            if ($color==1) {
                                                $fondo="productos_lista_diseno1_color1";
                                                $color=0;
                                            }else {
                                                $fondo="productos_lista_diseno1_color0";
                                                $color=1;
                                            }
                                            ?>
                                    <tr>
                                        <td class="<?=$fondo?>" align="left">
                                                    <?php
                                                    $atts = array(
                                                            'width'      => '774',
                                                            'height'     => '418',
                                                            'scrollbars' => 'no',
                                                            'status'     => 'no',
                                                            'resizable'  => 'no',
                                                            'screenx'    => '0',
                                                            'screeny'    => '0'
                                                    );
                                                    echo anchor_popup(base_url().'index.php/ecommerce_empresa1/detalle_producto/'.$row3->product_id,'<img src="'.base_url().'thumb/'.$row->product_id.'.jpg">',$atts);
                                                    ?>
                                        </td>
                                        <td class="<?=$fondo?>" align="left">
                                                    <?php
                                                    $atts = array(
                                                            'width'      => '774',
                                                            'height'     => '418',
                                                            'scrollbars' => 'no',
                                                            'status'     => 'no',
                                                            'resizable'  => 'no',
                                                            'screenx'    => '0',
                                                            'screeny'    => '0'
                                                    );
                                                    echo anchor_popup(base_url().'index.php/ecommerce_empresa1/detalle_producto/'.$row3->product_id,$row3->product_sku,$atts);
                                                    ?>
                                        </td>
                                        <td class="<?=$fondo?>" align="left">
                                                    <?php
                                                    echo anchor_popup(base_url().'index.php/ecommerce_empresa1/detalle_producto/'.$row3->product_id,$row3->product_name,$atts);
                                                    ?>
                                            <span id="fancy" title="<?=$row3->product_name?>"></span>

                                        </td>
                                                <?php $query = $this->modelo_ec->get_precio($row3->product_id);?>
                                        <td class="<?=$fondo?>" align="right">$<?=$this->modelo_ec->product_price?></td>
                                        <td class="<?=$fondo?>" abbr="right" >
                                            <input class="input_cantidades" name="quantity[<?=$row3->product_id?>]" size="4" tabindex="<?=$index?>">
                                        </td>
                                    </tr>
                                            <?php
                                            $index++;
                                        endforeach;?>
                                    <?php endforeach;?>
                                    <tr class="ui-widget-content jqgrow ui-row-ltr">
                                        <td colspan="5" class="categoria_diseno1" align="right">
                                            <input name="tipo" value="add_more" type="hidden">
                                            <input name="tipo1" value="pedido" type="hidden">
                                            <input type="image" tabindex="-1" src="<?=base_url();?>images/boton_enviar.gif" alt="Agregar al Pedido"/>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </form>
                        Clic en el codigo o en la descripcion para ver detalle del producto y foto
                    </div>
                </div>
            </div>
